Skip to content

Conversation

@Fyusel
Copy link
Contributor

@Fyusel Fyusel commented Oct 28, 2025

Description

The ConfigureClient() method was implemented for all clients with almost the same code. In order to reduce this code duplication a generic method was defined. The ConfigureClient() method is still present but is only a wrapper which means that the normal code does not need to be changed at all. This generic function still uses the region as parameter for some clients. This will be adjusted when all services have implemented the region adjustment.

For testing just execute the list command for every service (except the git service).

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Fyusel Fyusel requested a review from a team as a code owner October 28, 2025 11:20
@Fyusel Fyusel marked this pull request as draft October 28, 2025 12:27
@Fyusel Fyusel force-pushed the refactor-configure-client branch from b8bd1f8 to 8c9e1c3 Compare October 28, 2025 12:33
@Fyusel Fyusel marked this pull request as ready for review October 28, 2025 12:59
marceljk
marceljk previously approved these changes Oct 31, 2025
@Fyusel Fyusel force-pushed the refactor-configure-client branch from d8a3807 to 8308cb1 Compare November 3, 2025 07:49
@Fyusel Fyusel force-pushed the refactor-configure-client branch from 8308cb1 to 3201a41 Compare November 3, 2025 08:44
@Fyusel Fyusel force-pushed the refactor-configure-client branch from 3201a41 to 997863f Compare November 3, 2025 09:54
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/.github/docs/contribution-guide 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor/list 56.52% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/create 50.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete 17.02% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/describe 43.75% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/list 56.52% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/config 71.27% (+0.11%) 👍
github.com/stackitcloud/stackit-cli/internal/pkg/generic-client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/alb/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/authorization/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/dns/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/git/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/kms/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/load-balancer/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/logme/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/mariadb/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/object-storage/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/observability/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/opensearch/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/rabbitmq/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/redis/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/resourcemanager/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/runcommand/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/secrets-manager/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/serverbackup/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/serverosupdate/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/service-account/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/service-enablement/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/ske/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/sqlserverflex/client 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/.github/docs/contribution-guide/client.go 0.00% (ø) 0 0 0
github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor/list/list.go 56.52% (ø) 46 26 20
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/create/create.go 50.00% (ø) 52 26 26
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete/delete.go 17.02% (ø) 47 8 39
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/describe/describe.go 43.75% (ø) 48 21 27
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/list/list.go 56.52% (ø) 46 26 20
github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go 90.16% (+0.16%) 61 (+1) 55 (+1) 6 👍
github.com/stackitcloud/stackit-cli/internal/pkg/generic-client/generic_client.go 0.00% (ø) 17 (+17) 0 17 (+17)
github.com/stackitcloud/stackit-cli/internal/pkg/services/alb/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/authorization/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/dns/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/git/client/client.go 0.00% (ø) 1 (-17) 0 1 (-17)
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/client/client.go 0.00% (ø) 1 (-16) 0 1 (-16)
github.com/stackitcloud/stackit-cli/internal/pkg/services/kms/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/load-balancer/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/logme/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/mariadb/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/object-storage/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/observability/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/opensearch/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/rabbitmq/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/redis/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/resourcemanager/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/runcommand/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/secrets-manager/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/serverbackup/client/client.go 0.00% (ø) 1 (-16) 0 1 (-16)
github.com/stackitcloud/stackit-cli/internal/pkg/services/serverosupdate/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/service-account/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)
github.com/stackitcloud/stackit-cli/internal/pkg/services/service-enablement/client/client.go 0.00% (ø) 1 (-16) 0 1 (-16)
github.com/stackitcloud/stackit-cli/internal/pkg/services/ske/client/client.go 0.00% (ø) 1 (-15) 0 1 (-15)
github.com/stackitcloud/stackit-cli/internal/pkg/services/sqlserverflex/client/client.go 0.00% (ø) 1 (-14) 0 1 (-14)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@Fyusel Fyusel merged commit fc25893 into main Nov 3, 2025
5 checks passed
@Fyusel Fyusel deleted the refactor-configure-client branch November 3, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants